(function(){
    (function(LayaSample){
        //初始化引擎
        Laya.init(850,1280);
        Laya.stage.scaleMode = Laya.Stage.SCALE_FIXED_AUTO;
        Laya.stage.alignH = Laya.Stage.ALIGN_CENTER;
        Laya.stage.alignV = Laya.Stage.ALIGN_MIDDLE;
        Laya.stage.screenMode = Laya.Stage.SCREEN_NONE;
        //设置stage颜色
        Laya.stage.bgColor = "#000000";
        //Laya.Stat.show(0, 0) ;
        //加载资源
        var arr= [
            {url: "res/atlas/bao.json",type:Laya.Loader.ATLAS},
            {url: "res/config/carConfig.json",type:Laya.Loader.JSON},
        ] 
        Laya.loader.load(arr,Laya.Handler.create(this,onLoaded),null,Laya.Loader.ATLAS)
    })();
    function onLoaded(){
        //解决dialog和view不能共存；
         View.regComponent("Dialog",Dialog);
         var game = new Game();
         Laya.stage.addChild(game);
         Laya.stage.bgColor='#1f212e';

       if (true) return;
       //自定义按钮状态
       var image = new Laya.Image() 
       image.skin = "bao/bet1.png" 
       Utils.getInstance().registerButton(image,{normal:"bao/bet1.png",pressed:"bao/onbet1.png"})
       image.pos(Laya.stage.width/2,Laya.stage.height/2)
       Laya.stage.addChild(image)

        
        
    }
})(window.LayaSample || (window.LayaSample = {}));




